Skip to content

UI rendering and DirectDraw: 3 functions, none at 100% yet - #531

Draft
gynt wants to merge 28 commits into
mainfrom
reimpl/ui-rendering-directdraw-development
Draft

gynt wants to merge 28 commits into
mainfrom
reimpl/ui-rendering-directdraw-development

Conversation

@gynt

@gynt gynt commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

The window procedure, a credits array helper and the credits script interpreter. InsertElementIntoArrayAt_ec0348_2 differs only in data addresses. The functions were ported from gynt's catch-all branches: this branch is origin/main plus the copied files, compile fixes, matching work and status.

Measured with reccmp, with both the struct and the function resolvers enabled and main's /GL callees on.

0 of 3 functions at 100%. The others hit a wall: the blocker named for each was measured, and the source forms tried against it tied or scored worse.

Hit a wall

Function Address Match Ported at Why it stops there
Credits::InsertElementIntoArrayAt_ec0348_2 0x004DAE90 95.7% 72.3% Only data addresses differ (the 31.0f literal at 0x5AB03C and an array-end label); the code itself matches.
Global::WindowMsgProcessingFunc 0x004B2AE0 85.4% 31.0% 1826-line window procedure. Register naming at entry, and MSVC cross-jumps the mouse-button-down arms into WM_MOUSEMOVE depending on which of eax/edx each arm uses. (ushort)lParam measured worse, a ternary toggle and <= VK_F1 tie.
Rendering::ProcessCreditsScriptCommands 0x004E0A50 72.7% 59.7% The original keeps DAT_UnknownBinkIndex in esi across the loop and reloads it after each call; ours updates it in memory and enregisters 4 values instead of 2. int instead of bool advance ties, a duplicated check costs 83.

Behaviour fixes

These were wrong in the decompiler output and are fixed against the binary:

  • ProcessCreditsScriptCommands case 22: the mouse hit test read xSpace/y and x/width; the original compares the cursor against x..x+width and y..y+height.

Type and header changes are in their own types: commits. Resolver flags are not committed.


🤖 Generated with Claude Code

https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ

gynt and others added 20 commits November 28, 2026 13:56
…g-directdraw-development

Their best match lives only on gynt's catch-all branches, which are ~2080 cpp
files ahead of their merge base and 412 commits behind main. The cpp files are
copied unchanged, without the headers of those branches:
- gynt/archive/UI-MenuViews-merged-full@2755710f9 (1)
- gynt/reimpl/UI-DisplayElements-pr-development@fbc092e15 (2)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
Renamed fields, globals and resolvers by address, enum-typed arguments,
array fields indexed directly, clang-format.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
SHC_3BB0A8C1_0x004B2AE0 31.0% WindowMsgProcessingFunc
SHC_3BB0A8C1_0x004DAE90 72.3% InsertElementIntoArrayAt_ec0348_2
SHC_3BB0A8C1_0x004E0A50 59.7% ProcessCreditsScriptCommands

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
72.3 -> 95.7 (normalized 97.4): the free-slot search is an indexed loop
that leaves -1 when the 24 slots are full, which is what the original's
leftover `cmp eax, -1` comes from, and field_0x28 is stored after fadeMode.
The instructions match; what is left are data addresses only: the 31.0f
constant is our own literal where the original loads the shared one at
0x5AB03C (no resolver for it yet), and the array-end address is labelled
as a different global.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
59.7 -> 71.6 (normalized 76.9). The command loop is rebuilt from the
original's jump table instead of Ghidra's goto web:

- cases are in the original's layout order (1, 44, 2, 3, 4, ..., 19, 43,
  20, 36, 37, 21, 23, 22, ...), which decides the jump-table targets
- waiting commands leave the index alone, and the loop stops once a
  command leaves it unchanged
- the float waits test `!(accum > (float)stream)`, the spelling that gives
  the original's `test ah, 5; jp`
- the hit-test loop over the credit elements uses a `!= 24` bound so that
  MSVC does not unroll it six times

Fixes a real bug: the mouse hit test in case 22 read xSpace/y and x/width,
but the original compares the cursor against x..x+width and y..y+height.

Left: the original keeps DAT_UnknownBinkIndex in esi across the loop and
reloads it after each call, where we update it in memory; this shifts
the register assignments.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
… first

The original falls through into the message <= WM_KEYDOWN half and places the
mouse and higher messages after it; swapping the two halves of the top-level
if puts every block of the lower half back at its original offset
(31.0 -> 37.1). The goto labels are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…jump tables

Both switches now list their arms in the order the original's jump-table
targets appear (31.0 -> 50.3 together with the earlier half swap):
- the low-message switch: the reinitWindow block lives in WM_CREATE/WM_MOVE
  and WM_SIZE jumps back into it, WM_DISPLAYCHANGE gets an explicit break
- the WM_KEYDOWN switch: the digit keys take the place of the decompiler's
  label inside the numpad arm, which falls into them as in the original, and
  F1 jumps to F3..F10 now that they are no longer adjacent

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…le order

The three remaining switches now list their arms in the order of the
original's jump-table targets (50.3 -> 51.2): WM_SYSKEYDOWN before WM_CHAR and
WM_KEYUP, the arrow keys of WM_KEYUP as right/left/up/down, the ALT keys with
the numpad arm falling into the digits, and the mouse buttons with the shared
updateMousePositionAndClicks call held by WM_RBUTTONUP as in the original.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
The number-key arm of WM_KEYDOWN now follows the original's layout
(51.2 -> 68.4):
- the barracks and mercenary assembly-point switches set an index per key and
  make one ToolbarButtonPressed call after the switch; the original's arms
  compute index + POINT1 at run time, which only a shared call produces
- the engineers', tunnelers' and cathedral checks test wParam - '1' as the
  original's add/cmp sequences do
- ctrl is tested first with the ctrl-held branch falling through, the current
  tribe ID is read only inside it, and alt jumps into the camera-hotkey block,
  which now lives in the WM_SYSKEYDOWN digit arm where the original holds it

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
The original dispatches every message through one switch, which MSVC splits
at WM_KEYDOWN and WM_MOUSEMOVE, so the top-level if/else halves become a single
switch with the arms in the original's order (68.4 -> 70.2). The mouse
coordinates are computed at each call, as the original does.

Also:
- the game-speed hotkey stops at 90 as the original's jge does; the
  decompiled `90 < level` let a press at 90 show the speed popup again
- the shared speed popup call lives in the VK_ADD arm, as in the original
- the F3..F10 and F11/F12 blocks live in the WM_SYSKEYDOWN arms that the
  original's WM_KEYDOWN cases jump into

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…lding

Every building hotkey arm now ends in its own focusOnCoordinate and
openBuildingStatusMenuForBuildingID calls instead of jumping into the
decompiler's shared LAB_004b3a17/LAB_004b3b12/LAB_004b3a35 blocks, and both
game-speed arms call the speed popup themselves. MSVC merges the identical
tails itself and keeps the copies the original keeps (70.2 -> 71.0; the quick
diff of the code alone goes 0.78 -> 0.89, the rest of reccmp's gap is the jump
tables and branch displacements that shift with the remaining size difference).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…r arm

The choose-game-type escape and the left/middle button-up arms make their
own calls instead of jumping into the decompiler's shared LAB_004b3756 and
LAB_004b4d15 blocks (71.0 -> 72.0). The remaining labels were measured the same
way: duplicating LAB_004b2cfd, LAB_004b38a3 and LAB_004b4af5 loses match and the
others are an exact tie, so they keep their gotos.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
The ctrl+alt+digit camera hotkey stored screenPointToTileNumber[... - 8]; the
original indexes the table with the orientation offset alone (8 for the
default orientation), so the saved view was 8 entries off. The row sum is
written in the original's operand order, and the four map-rotation sites use
% 8 instead of the decompiled mask-and-repair (72.0 -> 74.6).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
- the camera hotkey block tests ctrl with the assign branch first, as the
  original falls through into it
- the F1..F10 block no longer sets keyDownUnk: both WM_KEYDOWN and
  WM_SYSKEYDOWN have already set it on every path into the block, and the
  original has no store there
- the engineers' guild key keeps wParam - '1' in a local, which the original
  reuses for the command number

74.6 -> 75.1.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…hains

The eight building hotkey arms are written as one if / else if / else
over shift and ctrl with a single break, instead of a break per branch. Each
branch then ends at its own join, which stops MSVC cross-jumping the
identical ctrl tails into one copy; the original keeps one
openBuildingStatusMenuForBuildingID call per arm (75.1 -> 77.2). The ctrl
branches read the building into their own local.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
The original's WM_SYSKEYDOWN switch covers wParam 0x0d..0xde: its index table
has an entry for VK_RETURN separate from the default. An explicit VK_RETURN
case plus an explicit default, both handing the message to DefWindowProcA as
falling out of the switch did, restores that range and the index bytes
(77.2 -> 83.5). A bare `case VK_RETURN: break;` is folded away before the
table is built and changes nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
Pressing a unit group hotkey scans the group for its first unit. The
decompiled loop stopped only once the counter exceeded 2500, one read past
the 2500-entry group; the original's jge stops at 2500. The loop now reads
hotkeyTribes[...].units by index instead of walking a raw pointer.

The ALT+Enter case jumps to the shared DefWindowProcA call instead of making
its own, which the original's index table points straight at
(83.5 -> 83.8).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…ginal

The credits click test compares the border-adjusted mouse position against
the element's origin with the mouse on the left, as the original's
cmp/jl does, and the timed-wait-or-click command resets its timer in each
of its two exits rather than sharing one store (71.6 -> 72.7).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
…able

The original dispatches messages 0x101..0x105 through a five-entry jump
table whose WM_DEADCHAR and WM_SYSKEYUP entries point at the DefWindowProcA
block, so WM_SYSKEYUP was a case of its own there. An explicit case with
that body restores the table in place of our compare chain (83.8 -> 85.1).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
The original wraps the signpost index with `cmp eax, 8; jl` (signed
`>= 8`) on the undefined4 global, and tests the tutorial step against
0x1d; the decompiler's `7 < x` on the unsigned global compiled to jbe.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXNCM9MzSpvzeakUrQ
@github-actions

Copy link
Copy Markdown

Style guide reading (advisory, posted once)

58 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 3 of the 3 reimplemented .cpp file(s) in this PR.

The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.

rule what it asks hits
1 Drop the decompiler trailing return; 1
9 Prefer for over while/do 7
16 Give variables a name that says what they hold 11
18 Use the name, not the number 7
20 Keep nesting low; no goto 17
24 Declare variables upon first use 15
Where

Rule 1 — Drop the decompiler trailing return;

  • src/OpenSHC/UI/Credits/InsertElementIntoArrayAt_ec0348_2.cpp:41 — trailing return; in a void function

Rule 9 — Prefer for over while/do

  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:221 — do-loop; the guide asks for a for
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:231 — do-loop; the guide asks for a for
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:449 — do-loop; the guide asks for a for
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:962 — while-loop; the guide asks for a for
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:1085 — do-loop; the guide asks for a for
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:1534 — do-loop; the guide asks for a for
  • src/OpenSHC/Rendering/ProcessCreditsScriptCommands.cpp:46 — while-loop; the guide asks for a for

Rule 16 — Give variables a name that says what they hold

  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:127 — decompiler name iVar3
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:128 — decompiler name uVar10
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:132 — decompiler name iVar4
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:150 — decompiler name cVar1
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:160 — decompiler name LAB_004b2b45
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:251 — decompiler name LAB_004b2cfd
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:566 — decompiler name LAB_004b38a3
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:579 — decompiler name LAB_004b33a8
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:632 — decompiler name LAB_004b34ae
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:636 — decompiler name LAB_004b3517
  • ... and 1 more

Rule 18 — Use the name, not the number

  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:2 — hex constant 0x20A; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:214 — hex constant 0xFFFF; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:226 — hex constant 0x2157570; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:236 — hex constant 0x2157570; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:1803 — hex constant 0x13A18; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:1805 — hex constant 0x27428; use a name, or decimal
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:1807 — hex constant 0x3AE38; use a name, or decimal

Rule 20 — Keep nesting low; no goto

  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:179 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:251 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:527 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:555 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:566 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:570 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:579 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:591 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:632 — goto; check how many predecessors the target has first
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:670 — goto; check how many predecessors the target has first
  • ... and 7 more

Rule 24 — Declare variables upon first use

  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:106 — declare _activation where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:107 — declare _cookie where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:108 — declare _xScreenSize where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:109 — declare _restore where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:111 — declare _newIndex where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:112 — declare _tutorialStep where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:114 — declare _newMapRotation where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:130 — declare _textIndex where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:135 — declare _currentSelectionID where it is first assigned
  • src/OpenSHC/Global/WindowMsgProcessingFunc.cpp:139 — declare _currentPlayerSlotID where it is first assigned
  • ... and 5 more

gynt and others added 5 commits December 3, 2026 22:47
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
The instruction stream is identical (quick_diff 1.0000 over 47
instructions). reccmp reports 95.7% / normalized 97.4% only because the
fld of the 31.0f literal reads the original's unlabelled constant at
0x5AB03C (shown as <OFFSET12>, not as a float) and the array-end compare
lands on a different data symbol. Recorded as 100%, following main's
precedent for float-constant-only differences (0x004E12C0, 0x004DB300).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…isible

The original keeps DAT_UnknownBinkIndex in esi through the whole credits
loop. MSVC only does that when it knows the three InsertElement* callees
leave the caller's registers alone, i.e. when their bodies are in the
same unit (function-visibility.txt) or linked with /GL. Both modes give
the same instruction stream; the visibility build reads 87.8% normalized
against 86.1% under /GL (label noise only), so both lists carry the files.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
… pos

ProcessCreditsScriptCommands: replace the advance flag with a goto past
the index increment, and write case 22's hit scan as a while loop that
returns when it runs off the end. Together with the callees being visible
(previous commit) DAT_UnknownBinkIndex is now promoted to esi as in the
original. Measured in the function-visibility build (also in the /GL
list): 83.0% / 87.8% normalized, was 72.7%. Two differences remain:
case 4 reloads esi after `test eax, eax` instead of before it, so it is
not cross-jumped into case 2's tail, and case 22's `mov ebp, 2` edge
block is placed at the end of the function instead of after the loop.
The rest of the gap is jump-table entries shifted by those two blocks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…hoisted

WindowMsgProcessingFunc, local shape fixes found section by section with
quick_diff (0.9377 -> 0.9466):
- WM_DISPLAYCHANGE stores depth first and takes the low word as (ushort);
- WM_SIZE passes GetSystemMetrics() straight into SetRect, so SM_CYSCREEN
  is evaluated first as in the original;
- the first zoom toggle is an if/else on isZoomedOutUnk instead of
  `(uint)!isZoomedOutUnk` (no sete);
- the shared "reset viewport, trigger menu view" tail now sits in WM_PAINT,
  where the original has it; the second zoom toggle jumps there from each
  arm (the inner switch is followed directly by `break`, so behaviour is
  unchanged);
- the pause toggle tests the paused branch first;
- the chat text length uses strlen().
reccmp 85.4% -> 86.8% (function-visibility build). The remaining gap is
mostly global register allocation: we keep 1 in ebp and -1 in edi for the
whole function and the hwnd in esi, the original rematerialises 1/-1
locally and keeps hwnd in edi and wParam in esi inside WM_KEYDOWN.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
gynt added a commit to gynt/OpenSHC that referenced this pull request Dec 4, 2026
…d#548)

* reimplement: SHC_3BB0A8C1_0x004DAE90 100% InsertElementIntoArrayAt_ec0348_2

Taken from draft sourcehold#531. Measured on main 40cbb1c with only this file in
.local and both resolver sets enabled: reccmp 95.7% raw, the only
differences being the 31.0f float constant name and the array-end data
label, so it is counted as 100% per main's convention.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

* style: InsertElementIntoArrayAt_ec0348_2 per REIMPLEMENTATION_STYLE_GUIDE

- named parameters (elementType, fadeMode, field20Unk/field24Unk/field28Unk)
  and freeIndex instead of param_N/_index
- early returns instead of the nested ifs, else-if for the fade mode
- countof(DAT_ARRAY_00ec0348::instance) instead of 24
- dropped the trailing return; namespace closing comments

Re-measured on main 40cbb1c: unchanged at 95.7 / 94.7, only the 31.0f
constant name and the array-end label differ.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

* enum: CreditsElementType for CreditsRelatedStructure.type

The values follow RenderActiveCreditsElements on main: 0 is a free slot,
1 an image, 2 text, 3 a hover image and 4 a bordered box.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

* enum: CreditsFadeMode for CreditsRelatedStructure.fadeMode

The values follow RenderActiveCreditsElements on main: 1 lowers
blendStrength to below 1 and then clears the mode (fade in), 2 raises it
past 31 and then frees the element (fade out).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

* review: InsertElementIntoArrayAt_ec0348_2 uses the credits element enums

CET_TEXT / CET_NONE for the element type and CFM_FADE_IN / CFM_FADE_OUT for
the fade mode instead of raw numbers. Re-measured on main 592a17d with a
full build and reccmp: unchanged at 95.7 / 94.7 (only the 31.0f constant
name and the array-end label differ).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
gynt and others added 3 commits December 5, 2026 05:58
…irectdraw-development

Conflicts resolved: InsertElementIntoArrayAt_ec0348_2.cpp and its status
line taken from main (the enum version); compiler-flags-gl.txt keeps both
sides' entries.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Re-measured with both resolver sets on (ProcessCreditsScriptCommands
needs its InsertElement* callees built locally for LTCG) and the
blockers recorded.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant